package com.freejava.usejpa.dao;

import com.freejava.usejpa.entity.Hero;
import org.springframework.data.domain.Example;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
import org.springframework.data.domain.Sort;
import org.springframework.stereotype.Component;

import java.util.List;
import java.util.Optional;

@Component("heroDao")
public class HeroRepositoryImpl implements HeroDao {

    @Override
    public List<Hero> findAll() {
        // other codes
        return findAll();
    }

    @Override
    public List<Hero> findAll(Sort sort) {
        return null;
    }

    @Override
    public Page<Hero> findAll(Pageable pageable) {
        return null;
    }

    @Override
    public List<Hero> findAllById(Iterable<Integer> iterable) {
        return null;
    }

    @Override
    public long count() {
        return 0;
    }

    @Override
    public void deleteById(Integer integer) {

    }

    @Override
    public void delete(Hero hero) {

    }

    @Override
    public void deleteAll(Iterable<? extends Hero> iterable) {

    }

    @Override
    public void deleteAll() {

    }

    @Override
    public <S extends Hero> S save(S s) {
        return null;
    }

    @Override
    public <S extends Hero> List<S> saveAll(Iterable<S> iterable) {
        return null;
    }

    @Override
    public Optional<Hero> findById(Integer integer) {
        return Optional.empty();
    }

    @Override
    public boolean existsById(Integer integer) {
        return false;
    }

    @Override
    public void flush() {

    }

    @Override
    public <S extends Hero> S saveAndFlush(S s) {
        return null;
    }

    @Override
    public void deleteInBatch(Iterable<Hero> iterable) {

    }

    @Override
    public void deleteAllInBatch() {

    }

    @Override
    public Hero getOne(Integer integer) {
        return null;
    }

    @Override
    public <S extends Hero> Optional<S> findOne(Example<S> example) {
        return Optional.empty();
    }

    @Override
    public <S extends Hero> List<S> findAll(Example<S> example) {
        return null;
    }

    @Override
    public <S extends Hero> List<S> findAll(Example<S> example, Sort sort) {
        return null;
    }

    @Override
    public <S extends Hero> Page<S> findAll(Example<S> example, Pageable pageable) {
        return null;
    }

    @Override
    public <S extends Hero> long count(Example<S> example) {
        return 0;
    }

    @Override
    public <S extends Hero> boolean exists(Example<S> example) {
        return false;
    }

    @Override
    public List<Hero> getHeroByNameContaining(String name) {
        if (name == "test") {
            return null;
        }
        return getHeroByNameContaining(name);
    }

    @Override
    public Hero getLatestHero() {
        return null;
    }
}
